perf(variant): build BinaryView arrays directly - #10640
Merged
Merged
Conversation
Jefffrey
reviewed
Aug 20, 2026
| builder | ||
| .try_append_view(block, start, end - start) | ||
| .expect("Failed to append view"); | ||
| views.push(make_view(&buffer[start..end], 0, start as u32)); |
Contributor
There was a problem hiding this comment.
buffer & offsets here is guaranteed to come from trusted/correct data?
Contributor
Author
There was a problem hiding this comment.
Yes. Both come from the private builders here, and the offsets are recorded from the same buffer that build() consumes. Invalid ranges would panic on buffer[start..end] before reaching new_unchecked, so the required invariants are guaranteed.
Jefffrey
approved these changes
Aug 22, 2026
Contributor
|
thanks @cakeni |
Jefffrey
pushed a commit
that referenced
this pull request
Aug 24, 2026
…10814) Fixes the parquet-variant-compute compilation failure introduced when #10708 was merged after #10640. BinaryViewArray::new_unchecked now expects Arc<[Buffer]>, but the call added by #10640 still passed Vec<Buffer>. This converts the newly constructed buffer vector into the required shared slice. Verified with: - cargo fmt --all -- --check - cargo check -p parquet-variant-compute --all-targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Finalizing VariantArrayBuilder replayed every offset through BinaryViewBuilder::try_append_view, repeating bounds and value validation for buffers and offsets produced internally by the Variant builders.
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?
No API or behavior changes. VariantArrayBuilder::build is approximately 30% faster in the focused many-small-values benchmark.
AI assistance
I identified and evaluated this optimization, chose the final approach, and reviewed and refined the implementation and benchmark. OpenAI Codex assisted with code exploration, drafting, and benchmark preparation.